#include<iostream>
using namespace std;
const int mod = 233333;
int main()
{
	long long x, n;
	cin >> x >> n;
	long long ans = 1;
	while (n) {
		if (n & 1)ans = (ans % mod * x) % mod;
		n >>= 1;
		x = x * (x % mod) % mod;
	}
	cout << ans % mod << endl;
	return 0;
}